package com.wzdigit.wms.basic.mapper.core.oqc;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wzdigit.framework.orm.mybatis.MyBatisRepository;
import com.wzdigit.wms.basic.domain.dtos.oqc.OqcInspDto;
import com.wzdigit.wms.basic.domain.oqc.OqcInsp;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@MyBatisRepository
public interface OqcInspMapper extends BaseMapper<OqcInsp> {

    OqcInsp selectByInspNo(@Param("inspNo") String inspNo);

    List<OqcInsp> selectWithStatusIsZeroAndOne(@Param("oqcStatusUnHandle") Integer oqcStatusUnHandle, @Param("oqcStatusPartHandle") Integer oqcStatusPartHandle);

    /**
     * oqc-定时任务-产品判检
     * 获取 OQC送检单(WMS_OQC_INSP) 状态(STATUS)等于 未处理(0)，部分处理(1)的送检单，找到对应OQC送检单明细(WMS_OQC_INSP_DTL)状态是“未处理”的产品SN明细列表
     * @param oqcStatusUnHandle
     * @param oqcStatusPartHandle
     * @param oqcdtlStatusUnHandle
     * @return
     */
    List<OqcInspDto> selectOqcTaskData();

    int updateStatusByIds(@Param("oqcInspIdList") List<Integer> oqcInspIdList, @Param("status") Integer status);
    
    int updateStatusById(@Param("oqcInspId") Integer oqcInspId, @Param("status") Integer status);

    //根据销售订单查询销售类型
    String selectTypeBySo(@Param("soNo") String  soNo);

    //查询已经翻牌的SN
    List<String> selectSucessSn(@Param("oqcId") Integer oqcId,@Param("status") Integer status);

}
